#wget https://gitee.com/ccwq/staticFileServer/raw/master/scripts/k2/frpcStart.sh && chmod +x frpcStart.sh && sh ./frpcStart.sh


killall frpc frps

mkdir -p /opt/bin/frp
cd /opt/bin/frp


cat > "/opt/bin/frp/myfrpc.ini" <<- \EOF

[common]
server_addr = soofs.top
server_port = 1324
privilege_token = 1599qpzmCC..
use_compression = true

[router]
type = http
local_ip = 192.168.123.1
local_port = 80
custom_domains = router.soofs.top

[router-ssh-ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 22222

[dsm-web]
type = http
local_ip = 192.168.123.10
local_port = 5000
custom_domains = dsm.soofs.top


[dsm-aria2]
type = http
local_ip = 192.168.123.10
local_port = 6880
custom_domains = aria2.soofs.top


[dsm-aria2-server]
type = tcp
local_ip = 192.168.123.10
local_port = 6800
remote_port = 6800

[dsm-aria2-explorer]
type = http
local_ip = 192.168.123.10
local_port = 6888
custom_domains = aria2-explorer.soofs.top

[dsm-web-dav]
type = tcp
local_ip = 192.168.123.10
local_port = 5005
remote_port = 5005

[dsm-ssh]
type = tcp
local_ip = 192.168.123.10
local_port = 55
remote_port = 2222

[dsm-web-serv]
type = http
local_ip = dsm
local_port = 80
custom_domains = www.soofs.top

EOF

if [ ! -f "./frpc" ]
then
    wget "http://coding.soofs.top/frpc"
    chmod +x ./frpc
fi

./frpc -c ./myfrpc.ini &
logger "frpc is runing"

